package cn.wolfcode.p2p.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.wolfcode.p2p.business.domain.PlatformBankInfo;
import cn.wolfcode.p2p.business.mapper.PlatformBankInfoMapper;
import cn.wolfcode.p2p.business.service.IPlatformBankInfoService;

@Service
@Transactional
public class PlatformBankInfoServiceImpl implements IPlatformBankInfoService {

	@Autowired
	private PlatformBankInfoMapper mapper;

	@Override
	public void saveOrUpdate(PlatformBankInfo pbi) {
		if (pbi.getId() != null) {
			this.mapper.updateByPrimaryKey(pbi);
		} else {
			this.mapper.insert(pbi);
		}
	}

	@Override
	public PlatformBankInfo get(Long id) {
		return this.mapper.selectByPrimaryKey(id);
	}

	@Override
	public List<PlatformBankInfo> list() {
		return this.mapper.selectAll();
	}

}
